package com.frxuexi.mdm_2207.demo

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.Button
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController

@Composable
fun Demo05(navController:NavHostController) {
    Column {
        Button(onClick = {
            navController.navigate("page2/aa")
        }) {
            Text(text = "登录")
        }
        /*Card(modifier = Modifier.fillMaxWidth(), colors = CardDefaults.cardColors(containerColor= Color.Yellow), border= BorderStroke(1.dp,Color.DarkGray)) {
            Text(text = "aa")
        }*/
        ElevatedCard(modifier = Modifier.fillMaxWidth()) {
            Text(text = "aa")
        }
    }
    
}

@Composable
fun Page2(navController:NavHostController,name:String){
    Row {
        Icon(imageVector = Icons.Default.ArrowBack, contentDescription = "", Modifier.clickable {
            navController.popBackStack()
        })
        Text(text = "第二个页面$name")
    }

}